<!--{include(file='head.html')}-->
<script src="template/jslib/xheditor/xheditor.js" type="text/javascript"></script>
<div id="wrap">
	<!--{include('left.html')}-->
	
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<form action="<!--{url('admin','content','helpsave')}-->" method="post" name="submitform" id="submitform">
		<div id="main_c">
		<!--{if $opertype == "edit"}-->
			<ul class="bk">
				<li>
					<label><em>*</em>主题：</label>
					<p>
						<input class="input_tx" value="<!--{$content.subject}-->" name="subject" id="subject" type="text" />
					</p>
				</li>
				<li>
					<label>类别：</label>
					<p>
						<select name="sortid">
							<!--{$sortopt}-->
						</select>
					</p>
				</li>
				<li>
					<label>排序：</label>
					<p>
						<input class="input_tx" value="<!--{$content.order}-->" name="order" type="text" />
					</p>
				</li>
				<li>
					<label>类型：</label>
					<p>
						<input type="radio" value="cont" name="contenttype" id="typecont" checked autocomplete="off" 
						<!--{if $content.contenttype == 'cont'}-->checked<!--{/if}-->/>文本内容
						<input type="radio" value="link" name="contenttype" id="typelink" autocomplete="off"
						<!--{if $content.contenttype == 'link'}-->checked<!--{/if}-->/>外部链接
					</p>
				</li>
				<li id="forcont" <!--{if $content.contenttype != 'cont'}-->class="none"<!--{/if}-->>
					<label><em>*</em>内容：</label>
					<p>
						<textarea name="content" id="content"><!--{$content.content}--></textarea>
					</p>
				</li>
				<li id="forlink" <!--{if $content.contenttype != 'link'}-->class="none"<!--{/if}-->>
					<label><em>*</em>链接：</label>
					<p>
						<input class="input_tx" value="<!--{$content.link}-->" name="link" type="text" />
					</p>
				</li>
			</ul>
		<!--{elseif $opertype=="add"}-->
			<ul class="bk">
				<li>
					<label><em>*</em>主题：</label>
					<p>
						<input class="input_tx" value="" name="subject" id="subject" type="text" />
					</p>
				</li>
				<li>
					<label>类别：</label>
					<p>
						<select name="sortid">
							<!--{$sortopt}-->
						</select>
					</p>
				</li>
				<li>
					<label>排序：</label>
					<p>
						<input class="input_tx" value="" name="order" type="text" />
					</p>
				</li>
				<li>
					<label>类型：</label>
					<p>
						<input type="radio" value="cont" name="contenttype" id="typecont" checked autocomplete="off"/>文本内容
						<input type="radio" value="link" name="contenttype" id="typelink" autocomplete="off"/>外部链接
					</p>
				</li>
				<li id="forcont">
					<label><em>*</em>内容：</label>
					<p>
						<textarea name="content" id="content"></textarea>
					</p>
				</li>
				<li id="forlink" class="none">
					<label><em>*</em>链接：</label>
					<p>
						<input class="input_tx" value="http://" name="link" id="link" type="text" />
					</p>
				</li>
			</ul>
		<!--{/if}-->
			<div class="bt_bk2">
					<input type="hidden" value="<!--{$opertype}-->" name="opertype" />
					<input type="hidden" value="<!--{def($contentid)}-->" name="contentid"/>
					<a href="javascript:;" class="btn" onclick="jssubmit('article');return false;"><span>保存</span></a>
			</div>
		</div>
		</form>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
<script type="text/javascript">
$(function(){
	$("#content").xheditor({upImgUrl:"<!--{url('admin','uploadfile','pic')}-->"});
	$("input[name='contenttype']").click(function() {
		var $this = $(this),
			val	  = $this.val();
		$("#forcont,#forlink").hide();
		$("#for"+val).show();
	});
});
</script>